<%@ include file="/common/taglibs.jsp"%>
<%
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevent caching at the proxy server
%>

<head>
    <title><fmt:message key="articulolist.title"/></title>
    <meta name="heading" content="<fmt:message key='articulolist.heading'/>"/>    
</head>

<form:form id="premioList">

<input type="hidden" id="idArticulo" value="${idArticulo}"/>

	<fieldset style="width: 400px">
	<legend><fmt:message key="common.filtros.busqueda"/></legend>
	
		<div>
			<fmt:message key="common.catalogo"/><br/>
			<select id="coCatalogo" name="coCatalogo" class="text large">
				<option value="0"><fmt:message key="label.itemdefault"/></option>
				<c:forEach var="catalogo" items="${catalogo}" varStatus="status">	
					<option value="${catalogo.id}">${catalogo.deCatalogo}</option>
				</c:forEach>			
			</select>
		</div><br/>					
		
		
					
		<div>
			<input type="button" onclick="buscarCodPremiosInst()" value="<fmt:message key="button.search"/>"/>
		</div>					
		</fieldset><br/><br/>

		<table id="premios" cellpadding="0" class="table" cellspacing="0" style="width: 700px" > 
			<thead> 
				<tr> 
		            <th scope="col"><fmt:message key="common.premio"/></th>
		            <th scope="col"><fmt:message key="common.articulo"/></th>
		            <th scope="col"><fmt:message key="common.puntos"/></th>
		            <th scope="col"><fmt:message key="common.dinero"/></th>           
		            <th scope="col"><fmt:message key="catalogoForm.codigo.premio.instanteo"/></th>            

				</tr>
			</thead> 
			<tbody id="premiosbody">
				<tr id="pattern" style="display:none;">
					<td> 
						<span id="tablePremio">Premio</span>						
					</td>
					<td> 
						<span id="tableArticulo">Articulo</span>						
					</td>	
					<td> 
						<span id="tablePuntos">Puntos</span>						
					</td>	
					<td> 
						<span id="tableDinero">Dinero</span>						
					</td>
					<td> 
						<span id="tableCodPremioInst">Codigo Premio Instantaneo</span>						
					</td>						
				
				</tr> 	
				<c:forEach var="premio" items="${premios}" varStatus="status">	
					<c:choose>
						  <c:when test="${status.index % 2 == 0}"><tr class="odd" ></c:when>
						  <c:otherwise><tr class="even" ></c:otherwise>
					</c:choose>
		            	<td>
							<a href="javascript:void(0)" title="Valor" onClick="Modalbox.hide({beforeHide: function(){$('copremioinstantaneoid').value = '${premio.coPremioInstantaneo}'}})" >
		                    	${premio.codigoPremio}
		                    </a> 		            	
						</td>
						<td>
		                    ${premio.deArticulo}
		                </td> 
		                <td>
		                    ${premio.puntos}
		                </td>
		         
		           		<td>
		                    ${premio.dinero}
		                </td>
		                <td>
		                	${premio.coPremioInstantaneo}
		                </td>
		             
		           </tr>
		        </c:forEach>				
			</tbody>
		</table> 
</form:form>
<script type='text/javascript' src="<c:url value="/dwr/interface/CatalogoService.js"/>"></script>